package com.zhuang.mycodeproject.delay;



import java.util.List;

public class DelayWorker implements Runnable{
    private String id;//业务id,表示业务类型
    private String key;//DelayQueueManager.DELAY_TASK_MAP中存储的key，执行后删除该key对应的值

    //todo:定义业务参数

    /*
     * @Author zhuang
     * @Description //TODO: 结合业务的构造函数
     * @Date  2022/2/14
     * @Param [id, key]
     * @return
     **/
    public DelayWorker(String id,String key) {
        this.id = id;
        this.key = key;
    }

    public DelayWorker(String id) {
        this.id = id;
    }

    public DelayWorker() {
    }

    @Override
    public void run() {
        //todo:相关业务逻辑处理
        //xx业务相关
        if("1".equals(this.id)){
           // System.out.println("开始执行光缆监测产生告警延迟任务");
            DelayQueueManager manager = DelayQueueManager.getInstance();
            manager.DELAY_TASK_MAP.remove(this.key);
            //todo：执行业务方法
        }

    }

}
